package com.ssy.lingxi.platform.manage.controller;

import com.ssy.lingxi.common.model.vo.SelectVO;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.platform.manage.service.IUnitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @menu 下拉框管理
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/30
 */
@RestController
@RequestMapping("/manage/select/")
public class SelectController {

    @Autowired
    private IUnitService unitService;

    /**
     * 查询中文单位下拉框
     * @param name 单位名称
     */
    @RequestMapping(value = "/getSelectCNUnit", method = RequestMethod.GET)
    public Wrapper<List<SelectVO>> getSelectCNUnit(@RequestParam("name") String name) {
        return Wrapper.success(unitService.getSelectCNUnit(name));
    }

    /**
     * 查询中文单位下拉框
     * @param name 单位名称
     */
    @RequestMapping(value = "/getSelectENUnit", method = RequestMethod.GET)
    public Wrapper<List<SelectVO>> getSelectENUnit(@RequestParam("name") String name) {
        return Wrapper.success(unitService.getSelectENUnit(name));
    }
}
